Make `dired-split' obsolete
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2021 22:58:42 +0000 (23:58 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 9 Nov 2021 22:58:42 +0000 (23:58 +0100)
* lisp/dired-aux.el (dired-tree-lessp): Adjust caller.
(dired-split): Make obsolete (bug#50572).

* lisp/ffap.el (ffap-list-env): Adjust comment.

lisp/dired-aux.el
lisp/ffap.el

index ef299b21fd627ef81543711f0eaf29fd85316a0b..7d81d45326ffb60e26a979cff9f2fe6b9fb61300 100644 (file)
@@ -2860,8 +2860,8 @@ of marked files.  If KILL-ROOT is non-nil, kill DIRNAME as well."
   ;;   if dired-actual-switches contained t.
   (setq dir1 (file-name-as-directory dir1)
        dir2 (file-name-as-directory dir2))
-  (let ((components-1 (dired-split "/" dir1))
-       (components-2 (dired-split "/" dir2)))
+  (let ((components-1 (split-string dir1 "/"))
+       (components-2 (split-string dir2 "/")))
     (while (and components-1
                components-2
                (equal (car components-1) (car components-2)))
@@ -2880,7 +2880,6 @@ of marked files.  If KILL-ROOT is non-nil, kill DIRNAME as well."
             nil)
            (t (error "This can't happen"))))))
 
-;; There should be a builtin split function - inverse to mapconcat.
 (defun dired-split (pat str &optional limit)
   "Splitting on regexp PAT, turn string STR into a list of substrings.
 Optional third arg LIMIT (>= 1) is a limit to the length of the
@@ -2890,6 +2889,7 @@ Thus, if SEP is a regexp that only matches itself,
    (mapconcat #'identity (dired-split SEP STRING) SEP)
 
 is always equal to STRING."
+  (declare (obsolete split-string "29.1"))
   (let* ((start (string-match pat str))
         (result (list (substring str 0 start)))
         (count 1)
index 964daaaa15df8f20cebce30c52c2a5b34f451047..5d3cee591be2101881e64ec23c90ccb6b55ca0e8 100644 (file)
@@ -651,7 +651,7 @@ also is substituted for the first empty-string component, if there is one.
 Uses `path-separator' to separate the path into substrings."
   ;; We cannot use parse-colon-path (files.el), since it kills
   ;; "//" entries using file-name-as-directory.
-  ;; Similar: dired-split, TeX-split-string, and RHOGEE's psg-list-env
+  ;; Similar: TeX-split-string, and RHOGEE's psg-list-env
   ;; in ff-paths and bib-cite.  The EMPTY arg may help mimic kpathsea.
   (if (or empty (getenv env))          ; should return something
       (let ((start 0) match dir ret)